﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AddressBook
{
    public partial class FormCreate : Form
    {
        private readonly AddressBookServices service = new AddressBookServices();
        public FormCreate()
        {
            InitializeComponent();
        }
       
        private void FormCreate_Load(object sender, EventArgs e)
        {
        }

        private void btnOK_Click_1(object sender, EventArgs e)
        {
            T001AddressBookCreateModel model = new T001AddressBookCreateModel()
            {
                Name = txtName.Text,
                PhoneNo = txtPhoneNo.Text,
                Email = txtEmail.Text,
                Memo = txtMemo.Text,
            };
            service.Create(model);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
